import { Provide } from '@midwayjs/core';

export class Printer {
  print() {
    for (let m = 1; m <= 9; m++) {
      let line = '';
      // let a = m;
      for (let i = 1; i <= m; i++) {
        // let b=i;
        const unit = m + '*' + i + '=' + m * i + ' ';
        // console.log(unit);
        line = line + unit;
      }
      console.log(line);
    }
  }
  printEx() {
    console.log('________________');
    for (let m = 1; m <= 9; m++) {
      let line = '';
      // let a = m;
      for (let i = 1; i <= m; i++) {
        // let b=i;
        const unit = m + '*' + i + '=' + m * i + ' ';
        // console.log(unit);
        line = line + unit;
      }
      console.log(line);
    }
    console.log('________________');
  }
}

@Provide('printerUltra')
export class PrinterUltra {
  print() {
    for (let m = 1; m <= 9; m++) {
      let line = '';
      // let a = m;
      for (let i = 1; i <= m; i++) {
        // let b=i;
        const unit = m + '*' + i + '=' + m * i + ' ';
        // console.log(unit);
        line = line + unit;
      }
      console.log(line);
    }
  }
}
